<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>tinydtls: crypto.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">tinydtls
   &#160;<span id="projectnumber">0.8.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">crypto.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdlib.h&gt;</code><br/>
<code>#include &lt;stdint.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="t__list_8h_source.html">t_list.h</a>&quot;</code><br/>
<code>#include &quot;aes/rijndael.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="global_8h_source.html">global.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="state_8h_source.html">state.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="numeric_8h_source.html">numeric.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="hmac_8h_source.html">hmac.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="ccm_8h_source.html">ccm.h</a>&quot;</code><br/>
</div>
<p><a href="crypto_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structaes128__ccm__t.html">aes128_ccm_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdtls__cipher__context__t.html">dtls_cipher_context_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdtls__handshake__parameters__ecdsa__t.html">dtls_handshake_parameters_ecdsa_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdtls__handshake__parameters__psk__t.html">dtls_handshake_parameters_psk_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdtls__security__parameters__t.html">dtls_security_parameters_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdtls__handshake__parameters__t.html">dtls_handshake_parameters_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a5962b0d908f9b15406ca53d27a33e08a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a5962b0d908f9b15406ca53d27a33e08a">DTLS_MAC_KEY_LENGTH</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a5962b0d908f9b15406ca53d27a33e08a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a829b5d5e4d693fdb3de335a0e2017076"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a829b5d5e4d693fdb3de335a0e2017076">DTLS_KEY_LENGTH</a>&#160;&#160;&#160;16 /* AES-128 */</td></tr>
<tr class="separator:a829b5d5e4d693fdb3de335a0e2017076"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae86031f934f3f5f3af42dad5ff8e8757"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#ae86031f934f3f5f3af42dad5ff8e8757">DTLS_BLK_LENGTH</a>&#160;&#160;&#160;16 /* AES-128 */</td></tr>
<tr class="separator:ae86031f934f3f5f3af42dad5ff8e8757"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4fa04874a476a8cc5048372b6d584dbe"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a4fa04874a476a8cc5048372b6d584dbe">DTLS_MAC_LENGTH</a>&#160;&#160;&#160;<a class="el" href="group__HMAC.html#ga060019cf2dab9903d58118fe1abe7018">DTLS_HMAC_DIGEST_SIZE</a></td></tr>
<tr class="separator:a4fa04874a476a8cc5048372b6d584dbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8106002d0d69d8da810321c65ac71385"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a8106002d0d69d8da810321c65ac71385">DTLS_IV_LENGTH</a>&#160;&#160;&#160;4  /* length of nonce_explicit */</td></tr>
<tr class="separator:a8106002d0d69d8da810321c65ac71385"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0df6db4f8c29f2b0aa5a1363b4f9127f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a0df6db4f8c29f2b0aa5a1363b4f9127f">MAX_KEYBLOCK_LENGTH</a>&#160;&#160;&#160;(2 * <a class="el" href="crypto_8h.html#a5962b0d908f9b15406ca53d27a33e08a">DTLS_MAC_KEY_LENGTH</a> + 2 * <a class="el" href="crypto_8h.html#a829b5d5e4d693fdb3de335a0e2017076">DTLS_KEY_LENGTH</a> + 2 * <a class="el" href="crypto_8h.html#a8106002d0d69d8da810321c65ac71385">DTLS_IV_LENGTH</a>)</td></tr>
<tr class="separator:a0df6db4f8c29f2b0aa5a1363b4f9127f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2648582ddf4c82abc01d8388bd3f15db"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a2648582ddf4c82abc01d8388bd3f15db">DTLS_MASTER_SECRET_LENGTH</a>&#160;&#160;&#160;48</td></tr>
<tr class="separator:a2648582ddf4c82abc01d8388bd3f15db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a0bdff7c0889f35601b4935098508a0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a5a0bdff7c0889f35601b4935098508a0">DTLS_RANDOM_LENGTH</a>&#160;&#160;&#160;32</td></tr>
<tr class="separator:a5a0bdff7c0889f35601b4935098508a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab96c8e0773a14d1ce1621eed1a78e2bd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#ab96c8e0773a14d1ce1621eed1a78e2bd">DTLS_PSK_MAX_CLIENT_IDENTITY_LEN</a>&#160;&#160;&#160;32</td></tr>
<tr class="separator:ab96c8e0773a14d1ce1621eed1a78e2bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59cd7c0b8724e1f9b910611623396080"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a59cd7c0b8724e1f9b910611623396080">DTLS_PSK_MAX_KEY_LEN</a>&#160;&#160;&#160;32</td></tr>
<tr class="separator:a59cd7c0b8724e1f9b910611623396080"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a72899232c09d09b86326c6f234addc02"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a72899232c09d09b86326c6f234addc02">dtls_kb_client_mac_secret</a>(Param, Role)&#160;&#160;&#160;((Param)-&gt;key_block)</td></tr>
<tr class="separator:a72899232c09d09b86326c6f234addc02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac8fdf3770dcd956ca10d1044a57a7a3a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#ac8fdf3770dcd956ca10d1044a57a7a3a">dtls_kb_server_mac_secret</a>(Param, Role)&#160;&#160;&#160;(<a class="el" href="crypto_8h.html#a72899232c09d09b86326c6f234addc02">dtls_kb_client_mac_secret</a>(Param, Role) + <a class="el" href="crypto_8h.html#a5962b0d908f9b15406ca53d27a33e08a">DTLS_MAC_KEY_LENGTH</a>)</td></tr>
<tr class="separator:ac8fdf3770dcd956ca10d1044a57a7a3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf318c989f5bb90b863154abbc408b66"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#acf318c989f5bb90b863154abbc408b66">dtls_kb_remote_mac_secret</a>(Param, Role)</td></tr>
<tr class="separator:acf318c989f5bb90b863154abbc408b66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa60519b0e9b775ccb0bdb46762f43418"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#aa60519b0e9b775ccb0bdb46762f43418">dtls_kb_local_mac_secret</a>(Param, Role)</td></tr>
<tr class="separator:aa60519b0e9b775ccb0bdb46762f43418"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f320854c9f4e9b2105649b3624976b0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a1f320854c9f4e9b2105649b3624976b0">dtls_kb_mac_secret_size</a>(Param, Role)&#160;&#160;&#160;<a class="el" href="crypto_8h.html#a5962b0d908f9b15406ca53d27a33e08a">DTLS_MAC_KEY_LENGTH</a></td></tr>
<tr class="separator:a1f320854c9f4e9b2105649b3624976b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5659b0737d72a2fa1b1335952f9c305"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#ab5659b0737d72a2fa1b1335952f9c305">dtls_kb_client_write_key</a>(Param, Role)&#160;&#160;&#160;(<a class="el" href="crypto_8h.html#ac8fdf3770dcd956ca10d1044a57a7a3a">dtls_kb_server_mac_secret</a>(Param, Role) + <a class="el" href="crypto_8h.html#a5962b0d908f9b15406ca53d27a33e08a">DTLS_MAC_KEY_LENGTH</a>)</td></tr>
<tr class="separator:ab5659b0737d72a2fa1b1335952f9c305"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aea906786dcfa12acb320df731c8db7f6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#aea906786dcfa12acb320df731c8db7f6">dtls_kb_server_write_key</a>(Param, Role)&#160;&#160;&#160;(<a class="el" href="crypto_8h.html#ab5659b0737d72a2fa1b1335952f9c305">dtls_kb_client_write_key</a>(Param, Role) + <a class="el" href="crypto_8h.html#a829b5d5e4d693fdb3de335a0e2017076">DTLS_KEY_LENGTH</a>)</td></tr>
<tr class="separator:aea906786dcfa12acb320df731c8db7f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:addc8fcbbdd80ba924d0ded2a6bae97f4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#addc8fcbbdd80ba924d0ded2a6bae97f4">dtls_kb_remote_write_key</a>(Param, Role)</td></tr>
<tr class="separator:addc8fcbbdd80ba924d0ded2a6bae97f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c9e39188a2e50eb942ce8c7cd8add36"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a7c9e39188a2e50eb942ce8c7cd8add36">dtls_kb_local_write_key</a>(Param, Role)</td></tr>
<tr class="separator:a7c9e39188a2e50eb942ce8c7cd8add36"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a726ef8efa2e072c3c5e1ea1019e716aa"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a726ef8efa2e072c3c5e1ea1019e716aa">dtls_kb_key_size</a>(Param, Role)&#160;&#160;&#160;<a class="el" href="crypto_8h.html#a829b5d5e4d693fdb3de335a0e2017076">DTLS_KEY_LENGTH</a></td></tr>
<tr class="separator:a726ef8efa2e072c3c5e1ea1019e716aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d3c04e5d39477a525b5255ab3240094"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a1d3c04e5d39477a525b5255ab3240094">dtls_kb_client_iv</a>(Param, Role)&#160;&#160;&#160;(<a class="el" href="crypto_8h.html#aea906786dcfa12acb320df731c8db7f6">dtls_kb_server_write_key</a>(Param, Role) + <a class="el" href="crypto_8h.html#a829b5d5e4d693fdb3de335a0e2017076">DTLS_KEY_LENGTH</a>)</td></tr>
<tr class="separator:a1d3c04e5d39477a525b5255ab3240094"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acdd95c24ec6aebf14dac6ee4386a79be"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#acdd95c24ec6aebf14dac6ee4386a79be">dtls_kb_server_iv</a>(Param, Role)&#160;&#160;&#160;(<a class="el" href="crypto_8h.html#a1d3c04e5d39477a525b5255ab3240094">dtls_kb_client_iv</a>(Param, Role) + <a class="el" href="crypto_8h.html#a8106002d0d69d8da810321c65ac71385">DTLS_IV_LENGTH</a>)</td></tr>
<tr class="separator:acdd95c24ec6aebf14dac6ee4386a79be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7119d3239c34d7e7f219200792339541"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a7119d3239c34d7e7f219200792339541">dtls_kb_remote_iv</a>(Param, Role)</td></tr>
<tr class="separator:a7119d3239c34d7e7f219200792339541"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae23208578ac21350cb5915d11da0a2e3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#ae23208578ac21350cb5915d11da0a2e3">dtls_kb_local_iv</a>(Param, Role)</td></tr>
<tr class="separator:ae23208578ac21350cb5915d11da0a2e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adcdadf1870e2acb2993b1a8726d26997"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#adcdadf1870e2acb2993b1a8726d26997">dtls_kb_iv_size</a>(Param, Role)&#160;&#160;&#160;<a class="el" href="crypto_8h.html#a8106002d0d69d8da810321c65ac71385">DTLS_IV_LENGTH</a></td></tr>
<tr class="separator:adcdadf1870e2acb2993b1a8726d26997"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a147bfdc558c2ec69ffdf388ae19ae01c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a147bfdc558c2ec69ffdf388ae19ae01c">dtls_kb_size</a>(Param, Role)</td></tr>
<tr class="separator:a147bfdc558c2ec69ffdf388ae19ae01c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c3cbd4d9e514757deda211e97c9c758"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a5c3cbd4d9e514757deda211e97c9c758">dtls_kb_digest_size</a>(Param, Role)&#160;&#160;&#160;<a class="el" href="crypto_8h.html#a4fa04874a476a8cc5048372b6d584dbe">DTLS_MAC_LENGTH</a></td></tr>
<tr class="separator:a5c3cbd4d9e514757deda211e97c9c758"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b039263057e157e1427c5d316133c3d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a9b039263057e157e1427c5d316133c3d">DTLS_EC_KEY_SIZE</a>&#160;&#160;&#160;32</td></tr>
<tr class="separator:a9b039263057e157e1427c5d316133c3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a99482a87021e817524d15c33e89e309c"><td class="memItemLeft" align="right" valign="top">typedef struct <br class="typebreak"/>
<a class="el" href="structdtls__cipher__context__t.html">dtls_cipher_context_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a99482a87021e817524d15c33e89e309c">dtls_cipher_context_t</a></td></tr>
<tr class="separator:a99482a87021e817524d15c33e89e309c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a41f1aa1e1380c5f51d9af32c0a53f7b1"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a41f1aa1e1380c5f51d9af32c0a53f7b1">dtls_crypto_alg</a> { <a class="el" href="crypto_8h.html#a41f1aa1e1380c5f51d9af32c0a53f7b1a1832208b0a725185016b59150ff74fc4">AES128</a> =0
 }</td></tr>
<tr class="separator:a41f1aa1e1380c5f51d9af32c0a53f7b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3710d42871d602387a5147c05bf9f1ef"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a3710d42871d602387a5147c05bf9f1ef">dtls_ecdh_curve</a> { <a class="el" href="crypto_8h.html#a3710d42871d602387a5147c05bf9f1efa517a66bf6725327c3240add3537f34ff">DTLS_ECDH_CURVE_SECP256R1</a>
 }</td></tr>
<tr class="separator:a3710d42871d602387a5147c05bf9f1ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aea7bd0a10cf289c033216a97c0ee701e"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#aea7bd0a10cf289c033216a97c0ee701e">dtls_p_hash</a> (<a class="el" href="group__HMAC.html#ga698cfa036e69361a93dcdd9b19579b23">dtls_hashfunc_t</a> h, const unsigned char *key, size_t keylen, const unsigned char *label, size_t labellen, const unsigned char *random1, size_t random1len, const unsigned char *random2, size_t random2len, unsigned char *buf, size_t buflen)</td></tr>
<tr class="separator:aea7bd0a10cf289c033216a97c0ee701e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e47576e502b5a6255f1b489a4915512"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a5e47576e502b5a6255f1b489a4915512">dtls_prf</a> (const unsigned char *key, size_t keylen, const unsigned char *label, size_t labellen, const unsigned char *random1, size_t random1len, const unsigned char *random2, size_t random2len, unsigned char *buf, size_t buflen)</td></tr>
<tr class="separator:a5e47576e502b5a6255f1b489a4915512"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1423f8111df1533241178461c10b50e3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a1423f8111df1533241178461c10b50e3">dtls_mac</a> (<a class="el" href="structdtls__hmac__context__t.html">dtls_hmac_context_t</a> *hmac_ctx, const unsigned char *record, const unsigned char *packet, size_t length, unsigned char *buf)</td></tr>
<tr class="separator:a1423f8111df1533241178461c10b50e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a288c4ec1a5110ab3f44ab3cb7c289e69"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a288c4ec1a5110ab3f44ab3cb7c289e69">dtls_encrypt</a> (const unsigned char *src, size_t length, unsigned char *buf, unsigned char *nounce, unsigned char *key, size_t keylen, const unsigned char *aad, size_t aad_length)</td></tr>
<tr class="separator:a288c4ec1a5110ab3f44ab3cb7c289e69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a99a8753c2eb9baf1e03fe0ffbb813b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a3a99a8753c2eb9baf1e03fe0ffbb813b">dtls_decrypt</a> (const unsigned char *src, size_t length, unsigned char *buf, unsigned char *nounce, unsigned char *key, size_t keylen, const unsigned char *a_data, size_t a_data_length)</td></tr>
<tr class="separator:a3a99a8753c2eb9baf1e03fe0ffbb813b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa53dfed4868e257d2485024b5c170bae"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#aa53dfed4868e257d2485024b5c170bae">dtls_psk_pre_master_secret</a> (unsigned char *key, size_t keylen, unsigned char *result, size_t result_len)</td></tr>
<tr class="separator:aa53dfed4868e257d2485024b5c170bae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f9937088ea2e1d19e7d472fecae9aaa"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a5f9937088ea2e1d19e7d472fecae9aaa">dtls_ecdh_pre_master_secret</a> (unsigned char *priv_key, unsigned char *pub_key_x, unsigned char *pub_key_y, size_t key_size, unsigned char *result, size_t result_len)</td></tr>
<tr class="separator:a5f9937088ea2e1d19e7d472fecae9aaa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a982fc9e78cd10d9323756b15b72c7970"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a982fc9e78cd10d9323756b15b72c7970">dtls_ecdsa_generate_key</a> (unsigned char *priv_key, unsigned char *pub_key_x, unsigned char *pub_key_y, size_t key_size)</td></tr>
<tr class="separator:a982fc9e78cd10d9323756b15b72c7970"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49f03039780664684d110d83a228b163"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a49f03039780664684d110d83a228b163">dtls_ecdsa_create_sig_hash</a> (const unsigned char *priv_key, size_t key_size, const unsigned char *sign_hash, size_t sign_hash_size, uint32_t point_r[9], uint32_t point_s[9])</td></tr>
<tr class="separator:a49f03039780664684d110d83a228b163"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa2d9b2a195a1d8e8c56b1af8cb7bc82"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#afa2d9b2a195a1d8e8c56b1af8cb7bc82">dtls_ecdsa_create_sig</a> (const unsigned char *priv_key, size_t key_size, const unsigned char *client_random, size_t client_random_size, const unsigned char *server_random, size_t server_random_size, const unsigned char *keyx_params, size_t keyx_params_size, uint32_t point_r[9], uint32_t point_s[9])</td></tr>
<tr class="separator:afa2d9b2a195a1d8e8c56b1af8cb7bc82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a802b3a2b267747a76d4557c6c9a899d7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a802b3a2b267747a76d4557c6c9a899d7">dtls_ecdsa_verify_sig_hash</a> (const unsigned char *pub_key_x, const unsigned char *pub_key_y, size_t key_size, const unsigned char *sign_hash, size_t sign_hash_size, unsigned char *result_r, unsigned char *result_s)</td></tr>
<tr class="separator:a802b3a2b267747a76d4557c6c9a899d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a035860da45ba2586a95c8ef7f539a3c9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a035860da45ba2586a95c8ef7f539a3c9">dtls_ecdsa_verify_sig</a> (const unsigned char *pub_key_x, const unsigned char *pub_key_y, size_t key_size, const unsigned char *client_random, size_t client_random_size, const unsigned char *server_random, size_t server_random_size, const unsigned char *keyx_params, size_t keyx_params_size, unsigned char *result_r, unsigned char *result_s)</td></tr>
<tr class="separator:a035860da45ba2586a95c8ef7f539a3c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5ae24f3621f545752732e318840d7e2b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a5ae24f3621f545752732e318840d7e2b">dtls_ec_key_from_uint32_asn1</a> (const uint32_t *key, size_t key_size, unsigned char *buf)</td></tr>
<tr class="separator:a5ae24f3621f545752732e318840d7e2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25930cdb27a6ffcf05e2c2a9c95a6af8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structdtls__handshake__parameters__t.html">dtls_handshake_parameters_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a25930cdb27a6ffcf05e2c2a9c95a6af8">dtls_handshake_new</a> ()</td></tr>
<tr class="separator:a25930cdb27a6ffcf05e2c2a9c95a6af8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa17bcdc666796e52788f82ee003bb172"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#aa17bcdc666796e52788f82ee003bb172">dtls_handshake_free</a> (<a class="el" href="structdtls__handshake__parameters__t.html">dtls_handshake_parameters_t</a> *handshake)</td></tr>
<tr class="separator:aa17bcdc666796e52788f82ee003bb172"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d568085636a04b4706b7e50df802a7b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structdtls__security__parameters__t.html">dtls_security_parameters_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a1d568085636a04b4706b7e50df802a7b">dtls_security_new</a> ()</td></tr>
<tr class="separator:a1d568085636a04b4706b7e50df802a7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad54069f2880b3c07185ebba736d02d17"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#ad54069f2880b3c07185ebba736d02d17">dtls_security_free</a> (<a class="el" href="structdtls__security__parameters__t.html">dtls_security_parameters_t</a> *security)</td></tr>
<tr class="separator:ad54069f2880b3c07185ebba736d02d17"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86e6ce9d4b4afcef355836955697f52c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a86e6ce9d4b4afcef355836955697f52c">crypto_init</a> ()</td></tr>
<tr class="separator:a86e6ce9d4b4afcef355836955697f52c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ae86031f934f3f5f3af42dad5ff8e8757"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_BLK_LENGTH&#160;&#160;&#160;16 /* AES-128 */</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00046">46</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a9b039263057e157e1427c5d316133c3d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_EC_KEY_SIZE&#160;&#160;&#160;32</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00309">309</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a8106002d0d69d8da810321c65ac71385"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_IV_LENGTH&#160;&#160;&#160;4  /* length of nonce_explicit */</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00048">48</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a1d3c04e5d39477a525b5255ab3240094"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_client_iv</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(<a class="el" href="crypto_8h.html#aea906786dcfa12acb320df731c8db7f6">dtls_kb_server_write_key</a>(Param, Role) + <a class="el" href="crypto_8h.html#a829b5d5e4d693fdb3de335a0e2017076">DTLS_KEY_LENGTH</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00168">168</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a72899232c09d09b86326c6f234addc02"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_client_mac_secret</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((Param)-&gt;key_block)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00143">143</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="ab5659b0737d72a2fa1b1335952f9c305"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_client_write_key</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(<a class="el" href="crypto_8h.html#ac8fdf3770dcd956ca10d1044a57a7a3a">dtls_kb_server_mac_secret</a>(Param, Role) + <a class="el" href="crypto_8h.html#a5962b0d908f9b15406ca53d27a33e08a">DTLS_MAC_KEY_LENGTH</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00155">155</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5c3cbd4d9e514757deda211e97c9c758"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_digest_size</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;<a class="el" href="crypto_8h.html#a4fa04874a476a8cc5048372b6d584dbe">DTLS_MAC_LENGTH</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00187">187</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="adcdadf1870e2acb2993b1a8726d26997"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_iv_size</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;<a class="el" href="crypto_8h.html#a8106002d0d69d8da810321c65ac71385">DTLS_IV_LENGTH</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00180">180</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a726ef8efa2e072c3c5e1ea1019e716aa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_key_size</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;<a class="el" href="crypto_8h.html#a829b5d5e4d693fdb3de335a0e2017076">DTLS_KEY_LENGTH</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00167">167</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="ae23208578ac21350cb5915d11da0a2e3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_local_iv</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">((Role) == <a class="code" href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8afd8391395303e28ee9b375232cb68a1e">DTLS_CLIENT</a>                      \</div>
<div class="line">   ? <a class="code" href="crypto_8h.html#a1d3c04e5d39477a525b5255ab3240094">dtls_kb_client_iv</a>(Param, Role)                 \</div>
<div class="line">   : <a class="code" href="crypto_8h.html#acdd95c24ec6aebf14dac6ee4386a79be">dtls_kb_server_iv</a>(Param, Role))</div>
<div class="ttc" id="peer_8h_html_ae30cd4bcffed73f79f17c09e5a1452c8afd8391395303e28ee9b375232cb68a1e"><div class="ttname"><a href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8afd8391395303e28ee9b375232cb68a1e">DTLS_CLIENT</a></div><div class="ttdef"><b>Definition:</b> <a href="peer_8h_source.html#l00047">peer.h:47</a></div></div>
<div class="ttc" id="crypto_8h_html_a1d3c04e5d39477a525b5255ab3240094"><div class="ttname"><a href="crypto_8h.html#a1d3c04e5d39477a525b5255ab3240094">dtls_kb_client_iv</a></div><div class="ttdeci">#define dtls_kb_client_iv(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00168">crypto.h:168</a></div></div>
<div class="ttc" id="crypto_8h_html_acdd95c24ec6aebf14dac6ee4386a79be"><div class="ttname"><a href="crypto_8h.html#acdd95c24ec6aebf14dac6ee4386a79be">dtls_kb_server_iv</a></div><div class="ttdeci">#define dtls_kb_server_iv(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00170">crypto.h:170</a></div></div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="crypto_8h_source.html#l00176">176</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa60519b0e9b775ccb0bdb46762f43418"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_local_mac_secret</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">((Role) == <a class="code" href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8afd8391395303e28ee9b375232cb68a1e">DTLS_CLIENT</a>                      \</div>
<div class="line">   ? <a class="code" href="crypto_8h.html#a72899232c09d09b86326c6f234addc02">dtls_kb_client_mac_secret</a>(Param, Role)             \</div>
<div class="line">   : <a class="code" href="crypto_8h.html#ac8fdf3770dcd956ca10d1044a57a7a3a">dtls_kb_server_mac_secret</a>(Param, Role))</div>
<div class="ttc" id="crypto_8h_html_ac8fdf3770dcd956ca10d1044a57a7a3a"><div class="ttname"><a href="crypto_8h.html#ac8fdf3770dcd956ca10d1044a57a7a3a">dtls_kb_server_mac_secret</a></div><div class="ttdeci">#define dtls_kb_server_mac_secret(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00144">crypto.h:144</a></div></div>
<div class="ttc" id="crypto_8h_html_a72899232c09d09b86326c6f234addc02"><div class="ttname"><a href="crypto_8h.html#a72899232c09d09b86326c6f234addc02">dtls_kb_client_mac_secret</a></div><div class="ttdeci">#define dtls_kb_client_mac_secret(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00143">crypto.h:143</a></div></div>
<div class="ttc" id="peer_8h_html_ae30cd4bcffed73f79f17c09e5a1452c8afd8391395303e28ee9b375232cb68a1e"><div class="ttname"><a href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8afd8391395303e28ee9b375232cb68a1e">DTLS_CLIENT</a></div><div class="ttdef"><b>Definition:</b> <a href="peer_8h_source.html#l00047">peer.h:47</a></div></div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="crypto_8h_source.html#l00150">150</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a7c9e39188a2e50eb942ce8c7cd8add36"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_local_write_key</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">((Role) == <a class="code" href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8afd8391395303e28ee9b375232cb68a1e">DTLS_CLIENT</a>                      \</div>
<div class="line">   ? <a class="code" href="crypto_8h.html#ab5659b0737d72a2fa1b1335952f9c305">dtls_kb_client_write_key</a>(Param, Role)              \</div>
<div class="line">   : <a class="code" href="crypto_8h.html#aea906786dcfa12acb320df731c8db7f6">dtls_kb_server_write_key</a>(Param, Role))</div>
<div class="ttc" id="crypto_8h_html_ab5659b0737d72a2fa1b1335952f9c305"><div class="ttname"><a href="crypto_8h.html#ab5659b0737d72a2fa1b1335952f9c305">dtls_kb_client_write_key</a></div><div class="ttdeci">#define dtls_kb_client_write_key(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00155">crypto.h:155</a></div></div>
<div class="ttc" id="crypto_8h_html_aea906786dcfa12acb320df731c8db7f6"><div class="ttname"><a href="crypto_8h.html#aea906786dcfa12acb320df731c8db7f6">dtls_kb_server_write_key</a></div><div class="ttdeci">#define dtls_kb_server_write_key(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00157">crypto.h:157</a></div></div>
<div class="ttc" id="peer_8h_html_ae30cd4bcffed73f79f17c09e5a1452c8afd8391395303e28ee9b375232cb68a1e"><div class="ttname"><a href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8afd8391395303e28ee9b375232cb68a1e">DTLS_CLIENT</a></div><div class="ttdef"><b>Definition:</b> <a href="peer_8h_source.html#l00047">peer.h:47</a></div></div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="crypto_8h_source.html#l00163">163</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a1f320854c9f4e9b2105649b3624976b0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_mac_secret_size</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;<a class="el" href="crypto_8h.html#a5962b0d908f9b15406ca53d27a33e08a">DTLS_MAC_KEY_LENGTH</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00154">154</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a7119d3239c34d7e7f219200792339541"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_remote_iv</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">((Role) == <a class="code" href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8a7c2a694fc87273c445ad661575b28255">DTLS_SERVER</a>                      \</div>
<div class="line">   ? <a class="code" href="crypto_8h.html#a1d3c04e5d39477a525b5255ab3240094">dtls_kb_client_iv</a>(Param, Role)                 \</div>
<div class="line">   : <a class="code" href="crypto_8h.html#acdd95c24ec6aebf14dac6ee4386a79be">dtls_kb_server_iv</a>(Param, Role))</div>
<div class="ttc" id="peer_8h_html_ae30cd4bcffed73f79f17c09e5a1452c8a7c2a694fc87273c445ad661575b28255"><div class="ttname"><a href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8a7c2a694fc87273c445ad661575b28255">DTLS_SERVER</a></div><div class="ttdef"><b>Definition:</b> <a href="peer_8h_source.html#l00047">peer.h:47</a></div></div>
<div class="ttc" id="crypto_8h_html_a1d3c04e5d39477a525b5255ab3240094"><div class="ttname"><a href="crypto_8h.html#a1d3c04e5d39477a525b5255ab3240094">dtls_kb_client_iv</a></div><div class="ttdeci">#define dtls_kb_client_iv(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00168">crypto.h:168</a></div></div>
<div class="ttc" id="crypto_8h_html_acdd95c24ec6aebf14dac6ee4386a79be"><div class="ttname"><a href="crypto_8h.html#acdd95c24ec6aebf14dac6ee4386a79be">dtls_kb_server_iv</a></div><div class="ttdeci">#define dtls_kb_server_iv(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00170">crypto.h:170</a></div></div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="crypto_8h_source.html#l00172">172</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="acf318c989f5bb90b863154abbc408b66"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_remote_mac_secret</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">((Role) == <a class="code" href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8a7c2a694fc87273c445ad661575b28255">DTLS_SERVER</a>                      \</div>
<div class="line">   ? <a class="code" href="crypto_8h.html#a72899232c09d09b86326c6f234addc02">dtls_kb_client_mac_secret</a>(Param, Role)             \</div>
<div class="line">   : <a class="code" href="crypto_8h.html#ac8fdf3770dcd956ca10d1044a57a7a3a">dtls_kb_server_mac_secret</a>(Param, Role))</div>
<div class="ttc" id="crypto_8h_html_ac8fdf3770dcd956ca10d1044a57a7a3a"><div class="ttname"><a href="crypto_8h.html#ac8fdf3770dcd956ca10d1044a57a7a3a">dtls_kb_server_mac_secret</a></div><div class="ttdeci">#define dtls_kb_server_mac_secret(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00144">crypto.h:144</a></div></div>
<div class="ttc" id="peer_8h_html_ae30cd4bcffed73f79f17c09e5a1452c8a7c2a694fc87273c445ad661575b28255"><div class="ttname"><a href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8a7c2a694fc87273c445ad661575b28255">DTLS_SERVER</a></div><div class="ttdef"><b>Definition:</b> <a href="peer_8h_source.html#l00047">peer.h:47</a></div></div>
<div class="ttc" id="crypto_8h_html_a72899232c09d09b86326c6f234addc02"><div class="ttname"><a href="crypto_8h.html#a72899232c09d09b86326c6f234addc02">dtls_kb_client_mac_secret</a></div><div class="ttdeci">#define dtls_kb_client_mac_secret(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00143">crypto.h:143</a></div></div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="crypto_8h_source.html#l00146">146</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="addc8fcbbdd80ba924d0ded2a6bae97f4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_remote_write_key</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">((Role) == <a class="code" href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8a7c2a694fc87273c445ad661575b28255">DTLS_SERVER</a>                      \</div>
<div class="line">   ? <a class="code" href="crypto_8h.html#ab5659b0737d72a2fa1b1335952f9c305">dtls_kb_client_write_key</a>(Param, Role)              \</div>
<div class="line">   : <a class="code" href="crypto_8h.html#aea906786dcfa12acb320df731c8db7f6">dtls_kb_server_write_key</a>(Param, Role))</div>
<div class="ttc" id="peer_8h_html_ae30cd4bcffed73f79f17c09e5a1452c8a7c2a694fc87273c445ad661575b28255"><div class="ttname"><a href="peer_8h.html#ae30cd4bcffed73f79f17c09e5a1452c8a7c2a694fc87273c445ad661575b28255">DTLS_SERVER</a></div><div class="ttdef"><b>Definition:</b> <a href="peer_8h_source.html#l00047">peer.h:47</a></div></div>
<div class="ttc" id="crypto_8h_html_ab5659b0737d72a2fa1b1335952f9c305"><div class="ttname"><a href="crypto_8h.html#ab5659b0737d72a2fa1b1335952f9c305">dtls_kb_client_write_key</a></div><div class="ttdeci">#define dtls_kb_client_write_key(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00155">crypto.h:155</a></div></div>
<div class="ttc" id="crypto_8h_html_aea906786dcfa12acb320df731c8db7f6"><div class="ttname"><a href="crypto_8h.html#aea906786dcfa12acb320df731c8db7f6">dtls_kb_server_write_key</a></div><div class="ttdeci">#define dtls_kb_server_write_key(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00157">crypto.h:157</a></div></div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="crypto_8h_source.html#l00159">159</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="acdd95c24ec6aebf14dac6ee4386a79be"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_server_iv</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(<a class="el" href="crypto_8h.html#a1d3c04e5d39477a525b5255ab3240094">dtls_kb_client_iv</a>(Param, Role) + <a class="el" href="crypto_8h.html#a8106002d0d69d8da810321c65ac71385">DTLS_IV_LENGTH</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00170">170</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="ac8fdf3770dcd956ca10d1044a57a7a3a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_server_mac_secret</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(<a class="el" href="crypto_8h.html#a72899232c09d09b86326c6f234addc02">dtls_kb_client_mac_secret</a>(Param, Role) + <a class="el" href="crypto_8h.html#a5962b0d908f9b15406ca53d27a33e08a">DTLS_MAC_KEY_LENGTH</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00144">144</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="aea906786dcfa12acb320df731c8db7f6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_server_write_key</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(<a class="el" href="crypto_8h.html#ab5659b0737d72a2fa1b1335952f9c305">dtls_kb_client_write_key</a>(Param, Role) + <a class="el" href="crypto_8h.html#a829b5d5e4d693fdb3de335a0e2017076">DTLS_KEY_LENGTH</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00157">157</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a147bfdc558c2ec69ffdf388ae19ae01c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_kb_size</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Param, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Role&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">(2 * (<a class="code" href="crypto_8h.html#a1f320854c9f4e9b2105649b3624976b0">dtls_kb_mac_secret_size</a>(Param, Role) +                <a class="code" href="crypto_8h.html#a726ef8efa2e072c3c5e1ea1019e716aa">\</a></div>
<div class="line"><a class="code" href="crypto_8h.html#a726ef8efa2e072c3c5e1ea1019e716aa">	dtls_kb_key_size</a>(Param, Role) + <a class="code" href="crypto_8h.html#adcdadf1870e2acb2993b1a8726d26997">dtls_kb_iv_size</a>(Param, Role)))</div>
<div class="ttc" id="crypto_8h_html_adcdadf1870e2acb2993b1a8726d26997"><div class="ttname"><a href="crypto_8h.html#adcdadf1870e2acb2993b1a8726d26997">dtls_kb_iv_size</a></div><div class="ttdeci">#define dtls_kb_iv_size(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00180">crypto.h:180</a></div></div>
<div class="ttc" id="crypto_8h_html_a1f320854c9f4e9b2105649b3624976b0"><div class="ttname"><a href="crypto_8h.html#a1f320854c9f4e9b2105649b3624976b0">dtls_kb_mac_secret_size</a></div><div class="ttdeci">#define dtls_kb_mac_secret_size(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00154">crypto.h:154</a></div></div>
<div class="ttc" id="crypto_8h_html_a726ef8efa2e072c3c5e1ea1019e716aa"><div class="ttname"><a href="crypto_8h.html#a726ef8efa2e072c3c5e1ea1019e716aa">dtls_kb_key_size</a></div><div class="ttdeci">#define dtls_kb_key_size(Param, Role)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00167">crypto.h:167</a></div></div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="crypto_8h_source.html#l00182">182</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a829b5d5e4d693fdb3de335a0e2017076"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_KEY_LENGTH&#160;&#160;&#160;16 /* AES-128 */</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00045">45</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5962b0d908f9b15406ca53d27a33e08a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_MAC_KEY_LENGTH&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00044">44</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a4fa04874a476a8cc5048372b6d584dbe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_MAC_LENGTH&#160;&#160;&#160;<a class="el" href="group__HMAC.html#ga060019cf2dab9903d58118fe1abe7018">DTLS_HMAC_DIGEST_SIZE</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00047">47</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a2648582ddf4c82abc01d8388bd3f15db"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_MASTER_SECRET_LENGTH&#160;&#160;&#160;48</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Length of DTLS master_secret </p>

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00059">59</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="ab96c8e0773a14d1ce1621eed1a78e2bd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_PSK_MAX_CLIENT_IDENTITY_LEN&#160;&#160;&#160;32</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00089">89</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a59cd7c0b8724e1f9b910611623396080"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_PSK_MAX_KEY_LEN&#160;&#160;&#160;32</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00092">92</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5a0bdff7c0889f35601b4935098508a0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_RANDOM_LENGTH&#160;&#160;&#160;32</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00060">60</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a0df6db4f8c29f2b0aa5a1363b4f9127f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MAX_KEYBLOCK_LENGTH&#160;&#160;&#160;(2 * <a class="el" href="crypto_8h.html#a5962b0d908f9b15406ca53d27a33e08a">DTLS_MAC_KEY_LENGTH</a> + 2 * <a class="el" href="crypto_8h.html#a829b5d5e4d693fdb3de335a0e2017076">DTLS_KEY_LENGTH</a> + 2 * <a class="el" href="crypto_8h.html#a8106002d0d69d8da810321c65ac71385">DTLS_IV_LENGTH</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Maximum size of the generated keyblock. Note that MAX_KEYBLOCK_LENGTH must be large enough to hold the pre_master_secret, i.e. twice the length of the pre-shared key + 1. </p>

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00055">55</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="a99482a87021e817524d15c33e89e309c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structdtls__cipher__context__t.html">dtls_cipher_context_t</a>  <a class="el" href="structdtls__cipher__context__t.html">dtls_cipher_context_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="a41f1aa1e1380c5f51d9af32c0a53f7b1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="crypto_8h.html#a41f1aa1e1380c5f51d9af32c0a53f7b1">dtls_crypto_alg</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a41f1aa1e1380c5f51d9af32c0a53f7b1a1832208b0a725185016b59150ff74fc4"></a>AES128</em>&#160;</td><td class="fielddoc">
</td></tr>
</table>

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00062">62</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<a class="anchor" id="a3710d42871d602387a5147c05bf9f1ef"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="crypto_8h.html#a3710d42871d602387a5147c05bf9f1ef">dtls_ecdh_curve</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a3710d42871d602387a5147c05bf9f1efa517a66bf6725327c3240add3537f34ff"></a>DTLS_ECDH_CURVE_SECP256R1</em>&#160;</td><td class="fielddoc">
</td></tr>
</table>

<p>Definition at line <a class="el" href="crypto_8h_source.html#l00065">65</a> of file <a class="el" href="crypto_8h_source.html">crypto.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a86e6ce9d4b4afcef355836955697f52c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void crypto_init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00076">76</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a3a99a8753c2eb9baf1e03fe0ffbb813b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_decrypt </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>nounce</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>keylen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>a_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>a_data_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decrypts the given buffer <code>src</code> of given <code>length</code>, writing the result to <code>buf</code>. The function returns <code>-1</code> in case of an error, or the number of bytes written. Note that for block ciphers, <code>length</code> must be a multiple of the cipher's block size. A return value between <code>0</code> and the actual length indicates that only <code>n-1</code> block have been processed. Unlike <a class="el" href="crypto_8h.html#a288c4ec1a5110ab3f44ab3cb7c289e69">dtls_encrypt()</a>, the source and destination of <a class="el" href="crypto_8h.html#a3a99a8753c2eb9baf1e03fe0ffbb813b">dtls_decrypt()</a> may overlap.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>The cipher context to use. </td></tr>
    <tr><td class="paramname">src</td><td>The buffer to decrypt. </td></tr>
    <tr><td class="paramname">length</td><td>The length of the input buffer. </td></tr>
    <tr><td class="paramname">buf</td><td>The result buffer. </td></tr>
    <tr><td class="paramname">aad</td><td>additional authentication data for AEAD ciphers </td></tr>
    <tr><td class="paramname">aad_length</td><td>actual size of <code>aad</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Less than zero on error, the number of decrypted bytes otherwise. </dd></dl>

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00550">550</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a5ae24f3621f545752732e318840d7e2b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_ec_key_from_uint32_asn1 </td>
          <td>(</td>
          <td class="paramtype">const uint32_t *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>key_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>buf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00362">362</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a5f9937088ea2e1d19e7d472fecae9aaa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_ecdh_pre_master_secret </td>
          <td>(</td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>priv_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>pub_key_x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>pub_key_y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>key_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>result</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>result_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00398">398</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="afa2d9b2a195a1d8e8c56b1af8cb7bc82"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtls_ecdsa_create_sig </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>priv_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>key_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>client_random</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>client_random_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>server_random</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>server_random_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>keyx_params</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>keyx_params_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>point_r</em>[9], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>point_s</em>[9]&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00463">463</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a49f03039780664684d110d83a228b163"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtls_ecdsa_create_sig_hash </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>priv_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>key_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>sign_hash</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>sign_hash_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>point_r</em>[9], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>point_s</em>[9]&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00446">446</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a982fc9e78cd10d9323756b15b72c7970"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtls_ecdsa_generate_key </td>
          <td>(</td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>priv_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>pub_key_x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>pub_key_y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>key_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00425">425</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a035860da45ba2586a95c8ef7f539a3c9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_ecdsa_verify_sig </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>pub_key_x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>pub_key_y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>key_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>client_random</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>client_random_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>server_random</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>server_random_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>keyx_params</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>keyx_params_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>result_r</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>result_s</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00503">503</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a802b3a2b267747a76d4557c6c9a899d7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_ecdsa_verify_sig_hash </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>pub_key_x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>pub_key_y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>key_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>sign_hash</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>sign_hash_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>result_r</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>result_s</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00483">483</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a288c4ec1a5110ab3f44ab3cb7c289e69"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_encrypt </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>nounce</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>keylen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>aad</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>aad_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encrypts the specified <code>src</code> of given <code>length</code>, writing the result to <code>buf</code>. The cipher implementation may add more data to the result buffer such as an initialization vector or padding (e.g. for block cipers in CBC mode). The caller therefore must ensure that <code>buf</code> provides sufficient storage to hold the result. Usually this means ( 2 + <code>length</code> / blocksize ) * blocksize. The function returns a value less than zero on error or otherwise the number of bytes written.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>The cipher context to use. </td></tr>
    <tr><td class="paramname">src</td><td>The data to encrypt. </td></tr>
    <tr><td class="paramname">length</td><td>The actual size of of <code>src</code>. </td></tr>
    <tr><td class="paramname">buf</td><td>The result buffer. <code>src</code> and <code>buf</code> must not overlap. </td></tr>
    <tr><td class="paramname">aad</td><td>additional data for AEAD ciphers </td></tr>
    <tr><td class="paramname">aad_length</td><td>actual size of <code>aad</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of encrypted bytes on success, less than zero otherwise. </dd></dl>

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00524">524</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="aa17bcdc666796e52788f82ee003bb172"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtls_handshake_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdtls__handshake__parameters__t.html">dtls_handshake_parameters_t</a> *&#160;</td>
          <td class="paramname"><em>handshake</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00146">146</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a25930cdb27a6ffcf05e2c2a9c95a6af8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structdtls__handshake__parameters__t.html">dtls_handshake_parameters_t</a>* dtls_handshake_new </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00123">123</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a1423f8111df1533241178461c10b50e3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtls_mac </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdtls__hmac__context__t.html">dtls_hmac_context_t</a> *&#160;</td>
          <td class="paramname"><em>hmac_ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>record</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>buf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Calculates MAC for record + cleartext packet and places the result in <code>buf</code>. The given <code>hmac_ctx</code> must be initialized with the HMAC function to use and the proper secret. As the DTLS mac calculation requires data from the record header, <code>record</code> must point to a buffer of at least <code>sizeof(dtls_record_header_t)</code> bytes. Usually, the remaining packet will be encrypted, therefore, the cleartext is passed separately in <code>packet</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hmac_ctx</td><td>The HMAC context to use for MAC calculation. </td></tr>
    <tr><td class="paramname">record</td><td>The record header. </td></tr>
    <tr><td class="paramname">packet</td><td>Cleartext payload to apply the MAC to. </td></tr>
    <tr><td class="paramname">length</td><td>Size of <code>packet</code>. </td></tr>
    <tr><td class="paramname">buf</td><td>A result buffer that is large enough to hold the generated digest. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00266">266</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="aea7bd0a10cf289c033216a97c0ee701e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t dtls_p_hash </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__HMAC.html#ga698cfa036e69361a93dcdd9b19579b23">dtls_hashfunc_t</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>keylen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>label</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>labellen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>random1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>random1len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>random2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>random2len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>buflen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Expands the secret and key to a block of DTLS_HMAC_MAX size according to the algorithm specified in section 5 of RFC 4346.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">h</td><td>Identifier of the hash function to use. </td></tr>
    <tr><td class="paramname">key</td><td>The secret. </td></tr>
    <tr><td class="paramname">keylen</td><td>Length of <code>key</code>. </td></tr>
    <tr><td class="paramname">seed</td><td>The seed. </td></tr>
    <tr><td class="paramname">seedlen</td><td>Length of <code>seed</code>. </td></tr>
    <tr><td class="paramname">buf</td><td>Output buffer where the result is XORed into The buffe must be capable to hold at least <code>buflen</code> bytes. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The actual number of bytes written to <code>buf</code> or 0 on error. </dd></dl>

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00183">183</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a5e47576e502b5a6255f1b489a4915512"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t dtls_prf </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>keylen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>label</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>labellen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>random1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>random1len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>random2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>random2len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>buflen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function implements the TLS PRF for DTLS_VERSION. For version 1.0, the PRF is P_MD5 ^ P_SHA1 while version 1.2 uses P_SHA256. Currently, the actual PRF is selected at compile time. </p>

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00249">249</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="aa53dfed4868e257d2485024b5c170bae"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_psk_pre_master_secret </td>
          <td>(</td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>keylen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>result</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>result_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generates pre_master_sercet from given PSK and fills the result according to the "plain PSK" case in section 2 of RFC 4279. Diffie-Hellman and RSA key exchange are currently not supported.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>The shared key. </td></tr>
    <tr><td class="paramname">keylen</td><td>Length of <code>key</code> in bytes. </td></tr>
    <tr><td class="paramname">result</td><td>The derived pre master secret. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The actual length of <code>result</code>. </dd></dl>

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00318">318</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="ad54069f2880b3c07185ebba736d02d17"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtls_security_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdtls__security__parameters__t.html">dtls_security_parameters_t</a> *&#160;</td>
          <td class="paramname"><em>security</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00174">174</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
<a class="anchor" id="a1d568085636a04b4706b7e50df802a7b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structdtls__security__parameters__t.html">dtls_security_parameters_t</a>* dtls_security_new </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="crypto_8c_source.html#l00155">155</a> of file <a class="el" href="crypto_8c_source.html">crypto.c</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Feb 27 2015 15:15:33 for tinydtls by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
